package com.zackratos.androidcomponent

import android.app.Application
import com.zackratos.bottomrouter.BottomRouterManager
import com.zackratos.component1.BottomComponent1
import com.zackratos.component2.BottomComponent2
import com.zackratos.component3.BottomComponent3
import com.zackratos.component4.BottomComponent4
import com.zackratos.toprouter.TopRouterManager

/**
 * @Author   : zhangwenchao
 * @Date     : 2020/12/29  8:03 PM
 * @Describe :
 */
class App: Application() {

    override fun onCreate() {
        super.onCreate()
        bottomRouterInitialization()
        topRouterInitialization()
    }

    private fun bottomRouterInitialization() {
        BottomRouterManager.getInstance().component1 = BottomComponent1.newInstance()
        BottomRouterManager.getInstance().component2 = BottomComponent2.newInstance()
        BottomRouterManager.getInstance().component3 = BottomComponent3.newInstance()
        BottomRouterManager.getInstance().component4 = BottomComponent4.newInstance()
    }

    private fun topRouterInitialization() {
        TopRouterManager.getInstance().initialization()
    }

}